import { createApp } from 'vue'
import ElementPlus from 'element-plus'

import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import DataVVue3 from '@kjgl77/datav-vue3'


import Avue from '@smallwei/avue'
import '@smallwei/avue/lib/index.css'


import vue3SeamlessScroll from 'vue3-seamless-scroll'
import naive from 'naive-ui'
import store from './store'
import { router } from './router'
import App from './App.vue'
import i18n from '~/locales'
import baseUI from './components/baseUI/index'
import { VueMasonryPlugin } from 'vue-masonry';
import 'vfonts/Lato.css'
// 等宽字体
import 'vfonts/FiraCode.css'
import 'normalize.css'
import './styles/animate.min.css'
import './styles/hover.css'
import 'wow.js/css/libs/animate.css'
import 'nprogress/nprogress.css'
import 'virtual:windi.css'
import './styles/main.css'
import './styles/vars.css'
import './components/baseUI/style/index.less'
import 'amfe-flexible/index.js'
import './icon/iconfont.css'


import './permission'
// 单个自定义指令使用方式
import permission from '~/directives/permission.js'

// 集中式管理自定义指令方式（自定义指令处理时间方式）
import registerDirreactives from '~/directives/directive'

// 插件的形式处理时间方式
import filterTimes from '~/composables/filterTime'

const app = createApp(App)
app.use(store)
app.use(router)
app.use(DataVVue3)
app.use(ElementPlus)
app.use(vue3SeamlessScroll)
app.use(naive)
app.use(i18n)
app.use(VueMasonryPlugin)
app.use(baseUI)
app.use(Avue)

for (const [key, component] of Object.entries(ElementPlusIconsVue))
  app.component(key, component)

// 自定义
app.use(permission)



registerDirreactives(app)
filterTimes(app)
// store.dispatch('init')

app.mount('#app')
